#ifndef PUSHSERVER_HANDLER_H
#define PUSHSERVER_HANDLER_H

#include "ServerErrorCode.h"
#include <sqlserver/SQLServer.h>
#include <httplib/httplib.h>
#include <nlohmann/json.hpp>

using namespace std;
using nlohmann::json;


/**路径
 */
namespace _ServerHandle_ {
    enum HandleType {
        GET,
        POST
    };

    struct Handle {
        HandleType type;
        const char *path{};
        httplib::Server::Handler func;

    };

    extern const char *title_field;
    extern const char *content_field;
    extern const char *token_field;
    extern const char *template_field;
    extern const char *application_json;


}

/**处理函数
 */
namespace _ServerHandle_ {
    extern const char *send_text_path;

    /**发送文本信息
     */
    void send_text_GET(const httplib::Request &, httplib::Response &);
}

namespace ServerHandle {
    using namespace _ServerHandle_;

    typedef list<Handle> Handle_List;
    extern Handle_List handles;
}
#endif //PUSHSERVER_HANDLER_H
